/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package telsoft.cms_admin.util;

/**
 *
 * @author Bannt
 */
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class treebean2 implements Serializable {

    private List<treebean2> children;
    private String description;
    private String name;
    private treebean2 parent;

    public void addChild(treebean2 child) {
        if (child.getParent() == null || !child.getParent().equals(this)) {
            child.setParent(this);
        }

        if (children == null) {
            children = new ArrayList<treebean2>();
        }

        if (!children.contains(child)) {
            children.add(child);
        }
    }

    public List<treebean2> getChildren() {
        if (children == null) {
            children = new ArrayList<treebean2>();
        }

        return Collections.unmodifiableList(children);
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public treebean2 getParent() {
        return parent;
    }

    public void setParent(treebean2 parent) {
        this.parent = parent;
    }
}
